package com.test.textGame.dto;

import com.test.textGame.algorithm.TopK;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Score implements Serializable {

    private static final long serialVersionUID = -6819189238222285219L;

    private Long userId;

    private String userName;

    /**
     * 分数
     */
    private Integer score;

    public Score(TopK.Node node) {
        this.userId = node.player.getUserId();
        this.userName = node.player.getUserName();
        this.score = node.score;
    }
}
